Models and Equality for Logical Programming

نویسندگان

  • Joseph A. Goguen
  • José Meseguer
چکیده

1 I n t r o d u c t i o n This paper argues that some very significant benefits are available to logic programming from using certain concepts from first order model theory, namely: • order-sorted logic and models; • initial models; • interpretation into rLxed models for certain fLxed sorts, functions and relations; and • true semantic equality. These techniques, which are all standard in the theory of abstract data types [17, 22, 14], provide an attractive alternative to the more syntactical and operational approaches generally favored in logic programming. Moreover, they provide a powerful approach that supports: • user-defined abstract data types; • built-in data types; • combined logic and functional programming; and • constraint-based programming, in a way that can utilize standard algorithms for standard problems, such as linear programming. In addition, we suggest that the more recent theory of institutions [I0] may provide conceptual insight and clarification, as well as a broadening of the general scope of logic programming, so as to encompass any logical system satisfying certain simple restrictions. In a sense, this paper is an attempt to explicate our previous paper on Eqlog [II], by giving a fuller account of its mathematical semantics, as well as further details, polemics, and comparisons with the 1Supported in part by Office of Naval Research Contracts N00014-85-C-0417 and N00014-86-C-0450, and a gift from the System Development Foundation. existing literature° One reason that [11] may have been obscure to many readers, is the large number of new ideas that it tried to introduce all at once~ here, we attempt to highlight certain ideas by ignoring others. Among the features of Eqlog deliberately downplayed here are: modules~ both hierarchical and generic; theories and views; and "attributes" of operators (e.g., associativity and commutativity}. Although these features greatly increase the expressive power of Eqlog, they would also distract from the basic foundational and semantic issues that we wish to emphasize here. For similar reasons, this paper does not develop most issues concerning the operational semantics of the various systems that are discussed. Thus, unification, term rewriting, narrowing and resolution are only touched upon. They are discussed in somewhat more detail in [11], and will receive full treatment in [23] and [26]. 1.1 Order -Sor ted Logic Ordinary unsorted logic offers the dubious advantage that anything can be applied to anything; for example, 3 * f i r s t n a ~ e ( a g e ( f a l s e ) ) < 2 birth-placo(teuperature(329)) is a well-formed expression. Although beloved by hackers of Lisp and Prolog, unsorted logic is too permissive. The trouble is that the usual alternative, many-sorted logic, is too restrictive, since it does not support overloading of function symbols such a s _ * for integer, rational, and complex numbers. In addition, an expression like ( -4 / -2) does not, strictly speaking, parse (assuming that factorial only applies to natural numbers). Here, we suggest that order-sor ted logic, with subsorts and operator loading, plus the additional twist of r e t r a c t s (although they are not discussed here; see [14]), really does provide sufficient expressiveness, while still banishing the truly meaningless. Although the specialization of many-sorted logic to many-sorted algebra has been very successfully applied to the theory of abstract data types, many-sorted algebra can produce some very awkward specifications in practice, primarily due to difficulties in handling erroneous expressions, such as dividing by zero in the rationals, or taking the top of an empty stack. In fact there is no really satisfactory way to define either the rationals or stacks with MSA. However, order-sorted algebra overcomes these obstacles through its richer type system, which supports subsorts, overloaded operators, and total functions that would otherwise have to be partial. Moreover, order-sorted algebra is the basis of both OBJ [9] and Eqlog [11]. Finally, order-sorted algebra solves the constructor-selector problem, which, roughly speaking, is to define inverses, called selectors, for constructors; the solution is to restrict selectors to the largest subsorts where they make sense. For example, pop and top are only defined for non-empty stacks. [15] shows not only that order-sorted algebra solves this problem, but also that many-sorted algebra cannot solve it. The essence of order-sorted logic is to provide a subsort partial ordering among the sorts, and to interpret it semantically as subset inclusion, among the carriers of a model, and to support operator overloading that is interpreted as restricting functions to subsorts. Two happy facts are that ordersorted logic is only slightly more difficult than many-sorted logic, and that essentially all results generalize from the many-sorted to the order-sorted case without complication. See [14] for a comprehensive treatment of order-sorted algebra. This paper broadens the logical framework to allow not only algebras, but also models of arbitrary first-order signatures, with both function and predicate symbols, including equality, and gives rules of deduction for Horn clauses in such a logic~ proving their completeness and several other basic results that are directly relevant to our model-theoretic account of logic and functional programming, including initiality and Herbrand theorems.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Inverse and Reverse 2-facility Location Problems with Equality Measures on a Network

In this paper we consider the inverse and reverse network facility location problems with considering the equity on servers. The inverse facility location with equality measure deals with modifying the weights of vertices with minimum cost, such that the difference between the maximum and minimum weights of clients allocated to the given facilities is minimized. On the other hand, the reverse c...

متن کامل

مبانی منطقی طراحی سیستم خط‌مشی‌گذاری دولتی برای تحقق عدالت حق‌مدار (براساس نهج‌البلاغه)

This article demonstrates a part of findings of a research that has been designed with the intention of determining the characteristics of the desired public policy making system for achieving social justice. To begin with, James P. Sterba's categorization of alternative political perspectives to justice is reviewed and then "truth – oriented" justice is studied. To reach a precise and scholar...

متن کامل

Matching Logic

This paper presents matching logic, a first-order logic (FOL) variant for specifying and reasoning about structure by means of patterns and pattern matching. Its sentences, the patterns, are constructed using variables, symbols, connectives and quantifiers, but no difference is made between function and predicate symbols. In models, a pattern evaluates into a power-set domain (the set of values...

متن کامل

A revisit of a mathematical model for solving fully fuzzy linear programming problem with trapezoidal fuzzy numbers

In this paper fully fuzzy linear programming (FFLP) problem with both equality and inequality constraints is considered where all the parameters and decision variables are represented by non-negative trapezoidal fuzzy numbers. According to the current approach, the FFLP problem with equality constraints first is converted into a multi–objective linear programming (MOLP) problem with crisp const...

متن کامل

Partial Functions and Equality in Answer Set Programming

In this paper we propose an extension of Answer Set Programming (ASP) [1], and in particular, of its most general logical counterpart, Quantified Equilibrium Logic (QEL) [2], to deal with partial functions. Although the treatment of equality in QEL can be established in different ways, we first analyse the choice of decidable equality with complete functions and Herbrand models, recently propos...

متن کامل

Enhancing the Expressiveness of Spider Diagram Systems

Many visual languages based on Euler diagrams have emerged for expressing relationships between sets. The expressive power of these languages varies, but the majority are monadic and some include equality. Spider diagrams are one such language, being equivalent in expressive power to monadic first order logic with equality. Spiders are used to represent the existence of elements or specific ind...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 1987